#include <bits/stdc++.h>
using namespace std;
int a[20]={2,3,5,7,11,13,17,19,23,29};
string ans="1";
string mul(string a, int b)
{
    const int L = 505;
    int na[L];
    string ans;
    int La = (int)a.size();
    fill(na, na + L, 0);
    for (int i = La - 1; i >= 0; i--) na[La - i - 1] = a[i] - '0';
    int w = 0;
    for (int i = 0; i < La; i++){
        na[i] = na[i] * b + w;
        w = na[i] / 10;
        na[i] = na[i] % 10;
    }
    while (w) {
        na[La++] = w % 10;
        w /= 10;
    }
    La--;
    while (La >= 0) ans += na[La--] + '0';
    return ans;
}

bool cmp(string x,string y){
    if(x.length()==y.length()){
        return x<y;
    }
    else return x.length()<y.length();
}

void dfs(string s,int k,int up,int ii){
    if(k==1){
        if(cmp(s,ans))ans=s;
    }
    for(int i=2;i<=min(k,up);i++){
        if(k%i==0){
            string ss=s;
            for(int j=1;j<i;j++){
                ss=mul(ss,a[ii]);
                if(cmp(ans,ss))return;
            }
            dfs(ss,k/i,i,ii+1);
        }
    }
}
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<450;i++)ans+='0';
    dfs("1",n,n,0);
    cout<<ans<<endl;
    return 0;
} 
